﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace 异常
{
    internal class Program
    {
        static void Main(string[] args)
        {
            try
            {
                throw new MyException(12, "hello world");
            }catch(MyException e)
            {
                WriteLine(e.Message);
            }
            finally
            {
                WriteLine("finish");
            }

            ReadKey();
        }
    }

    public class MyException : SystemException
    {
        private int num;
        private string message;

        public int Num
        {
            get => num;
            set => num = value;
        }

        public string Message
        {
            get => message;
            set => message = value;
        }

        public MyException(int num, string message)
        {
            this.num = num;
            this.message = message;
        }



    }
}
